package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class LoginRequest extends BaseRequest {

    public static final String PATH = BaseRequest.PATH + "api/phone_login";

    private String phoneNum;

    private String password;

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        LoginRequestBody body = new LoginRequestBody();
        body.setPhoneNum(phoneNum);
        body.setPassword(password);
        return body;
    }

    private class LoginRequestBody extends BaseRequestBody {

        @SerializedName("Phone")
        private String phoneNum;

        @SerializedName("Password")
        private String password;

        private LoginRequestBody() {
            setSv(BaseRequestConfig.SV_LOGIN);
        }

        public String getPhoneNum() {
            return phoneNum;
        }

        public void setPhoneNum(String phoneNum) {
            this.phoneNum = phoneNum;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }
    }
}
